using System;
using System.ComponentModel.DataAnnotations;
using InfoTech.VinhSon.Bussiness;

namespace InfoTech.VinhSon.Models
{
	[Serializable]
	public partial class LayoutModel
	{

		#region Constructor

		public LayoutModel()
		{
		}

		public LayoutModel(Layout value)
		{
			Id = value.Id;
			Name = value.Name;
			Area = value.Area;
			Controller = value.Controller;
			Action = value.Action;
			Partial = value.Partial ?? false;
		}

		#endregion

		#region Fields

		private System.Int32 _Id;

		private System.String _Name;

		private System.String _Area;

		private System.String _Controller;

		private System.String _Action;

		private System.Boolean _Partial;

		#endregion

		#region Properties

		//[Required]
		//[Range(0, 0]
		//[StringLength(0)]
		public System.Int32 Id
		{
			get
			{
				return _Id;
			}
			set
			{
				_Id = value;
			}
		}

        [Required]
		//[Range(0, 0]
		[StringLength(50)]
		public System.String Name
		{
			get
			{
				return _Name;
			}
			set
			{
				_Name = value;
			}
		}

        //[Required]
		//[Range(0, 0]
		[StringLength(50)]
		public System.String Area
		{
			get
			{
				return _Area;
			}
			set
			{
				_Area = value;
			}
		}

        [Required]
		//[Range(0, 0]
		[StringLength(50)]
		public System.String Controller
		{
			get
			{
				return _Controller;
			}
			set
			{
				_Controller = value;
			}
		}

        [Required]
		//[Range(0, 0]
		[StringLength(50)]
		public System.String Action
		{
			get
			{
				return _Action;
			}
			set
			{
				_Action = value;
			}
		}

		//[Required]
		//[Range(0, 0]
		//[StringLength(0)]
		public System.Boolean Partial
		{
			get
			{
				return _Partial;
			}
			set
			{
				_Partial = value;
			}
		}

		#endregion

		#region Operators

		public void Update(Layout value)
		{
			// value.Id = Id;
			value.Name = Name;
			value.Area = Area;
			value.Controller = Controller;
			value.Action = Action;
			value.Partial = Partial;
		}

		public static implicit operator LayoutModel(Layout obj)
		{
			return new LayoutModel(obj);
		}

		public static implicit operator Layout(LayoutModel obj)
		{
			Layout value = new Layout();
			obj.Update(value);
			return value;
		}

		#endregion

	}
}
